cmake_minimum_required(VERSION 3.10.2)
project("lib_torrent")

# 添加本地源码文件
add_library(
        lib_torrent               # 库名
        SHARED                   # 动态库
        lib_torrent.cpp          # 你的 cpp 文件名
)

# 添加 libtorrent 头文件搜索路径
include_directories("D:/MyDocument/MegNetDownloader/third_party/minimal_boost")
include_directories("D:/MyDocument/MegNetDownloader/third_party/libtorrent/include")
#include_directories("${CMAKE_SOURCE_DIR}/../../../../third_party/libtorrent/include")

# 声明外部预编译的 libtorrent-rasterbar 库
add_library(
        libtorrent-rasterbar
        SHARED
        IMPORTED
)

# 指定 libtorrent-rasterbar 的so文件路径（替换成你so文件的具体路径）
set_target_properties(
        libtorrent-rasterbar
        PROPERTIES IMPORTED_LOCATION "D:/MyDocument/MegNetDownloader/lib_torrent/src/main/jniLibs/arm64-v8a/libtorrent-rasterbar.so"
)



# 链接预编译库和系统日志库
find_library(log-lib log)

target_link_libraries(
        lib_torrent
        libtorrent-rasterbar
        ${log-lib}
)
